local weiqianlong = fk.CreateSkill{
  name = "hanqing__weiqianlong",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["hanqing__weiqianlong"] = "为潜龙",
  [":hanqing__weiqianlong"] = "锁定技，此武将牌不会出现在选将框。非主公玩家选择有主公技的武将牌作为武将时，其可以将之替换为此武将并立刻登场。",

  ["#hanqing__weiqianlong-invoke"] = "为潜龙：是否将武将替换为汗青·刘邦？",
}

weiqianlong:addEffect(fk.GamePrepared, {
  global = true,
  can_trigger = function (self, event, target, player, data)
    return player.role ~= "lord" and
      not table.contains(Fk:currentRoom().disabled_generals, "liubang") and
      table.find(Fk.generals[player.general]:getSkillNameList(true), function (s)
        return Fk.skills[s]:hasTag(Skill.Lord)
      end) and
      not table.find(player.room.players, function (p)
        return p.general == "liubang" or p.deputyGeneral == "liubang"
      end)
  end,
  on_cost = function (self, event, target, player, data)
    return player.room:askToSkillInvoke(player, {
      skill_name = weiqianlong.name,
      prompt = "#hanqing__weiqianlong-invoke",
    })
  end,
  on_use = function (self, event, target, player, data)
    player.room:changeHero(player, "liubang", true, false, true, true, true)
  end,
})

return weiqianlong
